﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/SiteMaster.Master"
    Inherits="System.Web.Mvc.ViewPage<Telerik.Web.Mvc.GridModel>" %>

<%@ Import Namespace="Microhard.Framework.MVCHelper" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    角色管理
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="section-header">
        <div class="title">
            <img src="<%=Url.Content("~/Content/images/ico-catalog.png")%>" alt="" />
            角色管理
        </div>
        <div class="options">
        </div>
    </div>
    <table class="adminContent">
        <tr>
            <td>
                <%Html.Telerik().Grid<Microhard.Permission.Models.Role>((List<Microhard.Permission.Models.Role>)this.Model.Data)
                    .Name("role-grid")
                    .ToolBar(t => t.Template(g =>
                    { 
                %>
                <%=Html.Authorized_AddButton("btnAdd","添加","Create","Role") %>
                <%=Html.Authorized_DeleteButton("btnDelete", "删除", "role-grid", "Delete", "Role","Admin")%>
                <%}))
                         .Columns(columns =>
                    {
                        columns.Bound(x => x.RoleId)
                       .Template(x => Html.CheckBox("checkedRecords", new { value = x.RoleId, @class = "gridCks" }))
                       .ClientTemplate("<input type='checkbox' name='checkedRecords' value='<#= RoleId #>' class='gridCks'/>")
                     .HtmlAttributes(new { style = "text-align:center" }).Title("选择").Width(30);

                        columns.Bound(x => x.RoleName).Title("角色名");
                    })
                     .DataBinding(dataBinding => dataBinding.Ajax().Select("_ListWithNoPaging", "Role"))
                   .EnableCustomBinding(true)
                    .Render();
                %>
            </td>
        </tr>
    </table>
</asp:Content>
